Skip to content

[rocprofiler-register] Fix compilation with system fmt/glog#1243

Merged
ammallya merged 2 commits intoROCm:developfrom
AngryLoki:fix-rocprofiler-register-find_package
Mar 6, 2026
Merged

[rocprofiler-register] Fix compilation with system fmt/glog#1243
ammallya merged 2 commits intoROCm:developfrom
AngryLoki:fix-rocprofiler-register-find_package

Conversation

@AngryLoki
Copy link
Contributor

@AngryLoki AngryLoki commented Oct 4, 2025

rocprofiler-register provides options to build with system glog and fmt: -DROCPROFILER_REGISTER_BUILD_GLOG=OFF -DROCPROFILER_REGISTER_BUILD_FMT=OFF. However these options don't work, because attempt to call

find_package(glog REQUIRED)
...
find_package(fmt REQUIRED)

in the nested external/CMakeLists.txt does not expose glog and fmt to the parent CMakeLists.txt. To make projects visible, the easiest way is to add GLOBAL:

find_package(glog REQUIRED GLOBAL)
...
find_package(fmt REQUIRED GLOBAL)

GLOBAL modifier requires CMake >= 3.24, which was not required in ROCm/rocm-systems, but ROCm/rocm-libraries already requires 3.25, so this change should be safe.

Closes #1242.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@ppanchad-amd ppanchad-amd assigned ammarwa and unassigned bwelton Nov 19, 2025
@ppanchad-amd ppanchad-amd requested a review from ammarwa November 19, 2025 20:36
rocprofiler-register provides options to build with system glog and fmt: `-DROCPROFILER_REGISTER_BUILD_GLOG=OFF -DROCPROFILER_REGISTER_BUILD_FMT=OFF`.
However these options don't work, because attempt to call
```cmake
find_package(glog REQUIRED)
...
find_package(fmt REQUIRED)
```
in the **nested** `external/CMakeLists.txt` does not expose glog and fmt to the **parent** `CMakeLists.txt`.
To make projects visible, the easiest way is to add `GLOBAL`:

```cmake
find_package(glog REQUIRED GLOBAL)
...
find_package(fmt REQUIRED GLOBAL)
```

GLOBAL modifier requires CMake >= 3.24, which was not required in
ROCm/rocm-systems, but ROCm/rocm-libraries already requires 3.25,
so this change should be safe.

Closes ROCm#1242.
@AngryLoki AngryLoki force-pushed the fix-rocprofiler-register-find_package branch from 21232b0 to 1f582ff Compare January 1, 2026 07:45
@AngryLoki AngryLoki requested a review from bwelton January 1, 2026 07:47
@ammallya ammallya merged commit c8ad252 into ROCm:develop Mar 6, 2026
11 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: rocprofiler-register fails to compile with system glog and fmt

5 participants